import React from "react";
import { useParams, useLocation, useNavigate } from 'react-router-dom'
function withRouter(Component) {
    return (props) => (
        <Component
            {...props}
            params={useParams()}
            location={useLocation()}
            navigate={useNavigate()}
        />
    );
}
class Tiaozhuan extends React.Component {
    constructor() {
        super()
    }
    render() {
        return <div>
            <h1 onClick={()=>this.props.navigate('/home')}>跳转到home页面</h1>
            <h2 onClick={() => this.props.navigate(-1)}>后退</h2>
        </div>
    }
}
export default withRouter(Tiaozhuan)